summaryrefslogtreecommitdiffstats
path: root/main.php
diff options
context:
space:
mode:
Diffstat (limited to 'main.php')
-rw-r--r--main.php33
1 files changed, 23 insertions, 10 deletions
diff --git a/main.php b/main.php
index 5bd0a49..2d50611 100644
--- a/main.php
+++ b/main.php
@@ -54,7 +54,7 @@ Errors:
class gimsisextClient {
private $username;
private $password;
- public $version = array(0, 9, 2);
+ public $version = array(0, 9, 3);
private $programname = "gimsisextclient";
private $programdomain = 'gimsisextclient.gimb.tk';
private $cookiedir; // set at runtime, ker je get_curerent_user, v login()
@@ -685,7 +685,6 @@ Errors:
case "3":
$opravicenoopis = "ne šteje";
break;
-
}
$opravicenostatus = intval(get_string_between($pr, '(<span class="opr', '">'));
$ura = intval(get_string_between($pr, '">', '</span>'));
@@ -771,18 +770,32 @@ Errors:
"naslov" => str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocenjevanje))),
"vrsta" => str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $vrsta))),
"rok" => str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $rok))),
- "ocena" => intval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocena)))),
- "zacasna" => boolval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $zacasna))))
);
- if(sizeof($sn->getElementsByTagName("span")) > 1) {
- $ocenaarray["novaocena"] = DOMinnerHTML($sn->getElementsByTagName("span")[1]);
+ if(sizeof($sn->getElementsByTagName("span")) > 1) { // v kolikor je nova ocena
+ $ocenaarray["ocena"] = DOMinnerHTML($sn->getElementsByTagName("span")[1]);
if(explode(" ", $sn->getElementsByTagName("span")[1]->getAttribute("class"))[1] == "ocVmesna") {
- $ocenaarray["novazacasna"] = 1;
+ $ocenaarray["zacasna"] = 1;
} else {
- $ocenaarray["novazacasna"] = 0;
+ $ocenaarray["zacasna"] = 0;
}
- $ocenaarray["novaocena"] = intval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocenaarray["novaocena"]))));
- $ocenaarray["novazacasna"] = boolval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocenaarray["novazacasna"]))));
+ $ocenaarray["ocena"] = intval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocenaarray["ocena"]))));
+ $ocenaarray["zacasna"] = boolval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocenaarray["zacasna"]))));
+ // sedaj pa vpišemo še staro oceno
+ $ocenaarray["staraocena"] = intval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, DOMinnerHTML($sn->getElementsByTagName("span")[0])))));
+ if(explode(" ", $sn->getElementsByTagName("span")[0]->getAttribute("class"))[1] == "ocVmesna") {
+ $zacasnn = true;
+ } else {
+ $zacasnn = false;
+ }
+ $ocenaarray["starazacasna"] = boolval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $zacasnn))));
+ } else { // v kolikor ni nove ocene
+ $ocenaarray["ocena"] = intval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, DOMinnerHTML($sn->getElementsByTagName("span")[0])))));
+ if(explode(" ", $sn->getElementsByTagName("span")[0]->getAttribute("class"))[1] == "ocVmesna") {
+ $zacasnn = true;
+ } else {
+ $zacasnn = false;
+ }
+ $ocenaarray["zacasna"] = boolval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $zacasnn))));
}
$ocene[] = $ocenaarray;
}